package fy.mdm.operator;

import com.seeyon.v3x.services.flow.bean.FlowExport;
import com.seeyon.v3x.services.form.bean.ValueExport;

import fy.form.listen.operate.AForm_Save_Operator;
import fy.form.listen.operate.IFormOperator;
import fy.mdm.bean.ProviderBean;
import fy.mdm.dao.Providerdao;
import fy.mdm.dao.SampleReviewDao;



public class ProviderOperator extends AForm_Save_Operator implements IFormOperator{
	private ProviderBean bean=new ProviderBean();
	@Override
	public String getFormName() {
		// TODO Auto-generated method stub
		return "供应商导入";
	}

	@Override
	protected void parseOtherField_FirstStep(FlowExport flowExport) {
		// TODO Auto-generated method stub

	}

	@Override
	protected void parseValueExport(ValueExport ve) {
		// TODO Auto-generated method stub
		String fieldName = ve.getDisplayName();
		if ("供应商名称".equals(fieldName)) {
			bean.setProviderName(ve.getValue());
		} else if ("供应商编码".equals(fieldName)) {
			bean.setProviderCode(ve.getValue());
		} 
	}

	@Override
	protected boolean save() {
		// TODO Auto-generated method stub

		try {
			Providerdao Providerdao=new Providerdao();
			Providerdao.setProviderBean(bean);
			return Providerdao.getStateReturn();
		} catch (Exception e) {
			e.printStackTrace();
		}finally {
			//bean.clear();
				bean = null;
			}
		return success;
	}
	}




